/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package music.Chords;

/**
 *
 * @author TJ
 */
public enum IntervalQuality {
    MINOR("m"),MAJOR("M"),DIMINISHED("d"),AUGMENTED("A"),NONE,SUS_2("sus2"),SUS_4("sus4");
    private String notation;
    IntervalQuality(){}
    IntervalQuality(String abbr){
        notation=abbr;
    }
    public String getNotation(){return notation;}
    public static IntervalQuality getDefaultQualityFromChordQuality(ChordQuality s){
        switch(s) {
            case MINOR:             return IntervalQuality.MINOR;
            case DIMINISHED:        return IntervalQuality.DIMINISHED;
            case AUGMENTED:         return IntervalQuality.MINOR;
            case HALF_DIMINISHED:   return IntervalQuality.MINOR;
            case DOMINANT:          return IntervalQuality.MINOR;
            default:                return IntervalQuality.MAJOR;
             
        }
    }
    public static IntervalQuality getQualityFromString(String s){
        if(s.equals("m") || s.toLowerCase().equals("min")) {
            return IntervalQuality.MINOR;
        }else if(s.equals("o") || s.toLowerCase().equals("dim")) {
            return IntervalQuality.DIMINISHED;
        } else if(s.equals("sus") || s.equals("sus4")) {return IntervalQuality.SUS_4;}
        else if(s.equals("sus2")) {return IntervalQuality.SUS_2;}
        else if(s.equals("no3")) {return IntervalQuality.NONE;}
        return IntervalQuality.MAJOR;}
}
